package vn.demand.dragon.editor
{
	import mx.controls.CheckBox;
	import mx.controls.dataGridClasses.DataGridListData;
	
	import vn.demand.utils.DpUtils;
	
	public class MyCheckBox extends CheckBox
	{
		public function MyCheckBox()
		{
		}

		override public function set data(value:Object):void {
			 super.data = value;
       
            if (value != null)
            {
                var myvalue = value[DataGridListData(listData).dataField];
                selected = DpUtils.isTrue(myvalue);
            }
            else
            {
                // If value is null, clear text.
                selected = false;
            }
            super.invalidateDisplayList();
		} 
	}
}